﻿using System.Windows.Controls;
using Microsoft.Practices.Unity;
using Moop.UI.ViewModels;
using System.Diagnostics;
using System.Collections.ObjectModel;
using System.Windows.Media;


namespace Moop.UI.Views
{
    public partial class ServerView : UserControl
    {
        public ServerView()
        {
            InitializeComponent();            
        }

        //Yes, binding with Heirarchical Data Template will not work here - I will try to make it work later
        private void cboSelectedCube_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            dimStackPanel.Children.RemoveRange(1, dimStackPanel.Children.Count);
            TreeView cubeTreeView = ((ServerViewModel)DataContext).GetCubeTreeView();
            cubeTreeView.Margin = new System.Windows.Thickness { Left = 0, Top = 10, Right = 0, Bottom = 0 };
            cubeTreeView.BorderBrush = new SolidColorBrush() { Opacity = 100 };
            dimStackPanel.Children.Add(cubeTreeView);
        }
    }
}
